import type { TableColumn, FormField } from '@/components'

export const fields: FormField[] = [
  {
    key: 'labelName',
    label: '使用人',
    tag: 'ElInput'
  },
  {
    key: 'labelName',
    label: '所属部门',
    tag: 'ElInput'
  },
  {
    key: 'labelName',
    label: '所属应用',
    tag: 'ElInput'
  },
  {
    key: 'typeId',
    label: '操作时间',
    tag: 'el-date-picker',
    attrs: {
      type: 'datetimerange',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
      format: 'YYYY-MM-DD',
      dateFormat: 'YYYY/MM/DD',
      style: 'width:220px'
    }
  }
]

export const columns: TableColumn[] = [
  {
    key: 'operName',
    label: '姓名'
  },
  {
    key: 'workNo',
    label: '工号'
  },
  {
    key: 'orgName',
    label: '所属单位'
  },
  {
    key: 'deptName',
    label: '所属部门'
  },
  {
    key: 'title',
    label: '所属应用'
  },
  {
    key: 'jsonResult',
    label: '操作概况'
  },
  {
    key: 'operTime',
    label: '操作时间'
  },
  {
    key: 'actions',
    label: '操作',
    slot: true,
    fixed: 'right'
  }
]

export const dialogFields: FormField[] = [
  {
    key: 'typeId',
    label: '限制时间',
    tag: 'el-date-picker',
    attrs: {
      type: 'datetimerange',
      startPlaceholder: '开始时间',
      endPlaceholder: '结束时间',
      format: 'YYYY-MM-DD HH:mm:ss',
      dateFormat: 'YYYY/MM/DD ddd',
      timeFormat: 'A hh:mm:ss'
    },
    validateRules: [
      {
        required: true,
        message: '请输入',
        trigger: 'change'
      }
    ]
  },
  {
    key: 'labelName',
    label: '账户名称',
    tag: 'ElInput',
    validateRules: [
      {
        required: true,
        message: '请输入',
        trigger: 'change'
      }
    ]
  },
  {
    key: 'labelRule',
    label: '使用人',
    tag: 'ElInput',
    validateRules: [
      {
        required: true,
        message: '请输入',
        trigger: 'change'
      }
    ]
  },
  {
    key: 'labelPattern',
    label: '删除阈值',
    tag: 'ElInput',
    validateRules: [
      {
        required: true,
        message: '请输入',
        trigger: 'change'
      }
    ]
  }
]
